13. Video: Fitting A Regression Line
Fitting A Regression Line
The main algorithm used to find the best fit line is called the least-squares algorithm, which finds the line that minimizes \sum\limits_{i=1}^n(y_i - \hat{y_i})^2.
There are other ways we might choose a "best" line, but this algorithm tends to do a good job in many scenarios.